import request from '@/utils/request'

export function getEmployeeSimple() {
  return request({
    url: '/sys/user/simple',
    method: 'get'
  })
}
export function getEmployees(params) {
  return request({
    url: '/sys/user',
    method: 'get',
    params
  })
}
/**
 * @description: 删除员工
 * @param {*} id 员工id
 * @return {*}
 */
export function delEmployee(id) {
  return request({
    method: 'delete',
    url: `/sys/user/${id}`
  })
}

export function addEmployees(data) {
  return request({
    method: 'post',
    url: '/sys/user',
    data
  })
}
export function importEmployees(data) {
  return request({
    method: 'post',
    url: '/sys/user/batch',
    data
  })
}
export function updateEmployee(data) {
  return request({
    method: 'put',
    url: '/sys/user/' + data.id,
    data
  })
}
// 给员工分配角色
export function assignRoles(data) {
  return request({
    method: 'put',
    url: '/sys/user/assignRoles',
    data
  })
}

